package pro.lepers.portfolio.view.contents.portfolio.data {
	import fr.digitas.flowearth.core.IIterator;
	import fr.digitas.flowearth.mvc.address.structs.INode;
	import fr.digitas.flowearth.mvc.address.structs.descriptor.INodeDescriptor;

	import pro.lepers.portfolio.view.contents.portfolio.data.contents.ProjectContentProvider;

	/**
	 * @author plepers
	 */
	public class ProjectDatas implements INodeDescriptor {
		


		public function get node () : INode {
			return _rootNode.getChild( _id );
		}
		
		public function get id () : String {
			return _id;
		}
		
		public function get title () : String {
			return _title;
		}
		
		public function get desc () : String {
			return _desc;
		}
		
		public function get date () : Date {
			return _date;
		}
		
		public function get contentsProvider() : ProjectContentProvider {
			return _contentsProvider;
		}


		public function dispose() : void {
			_contentsProvider.dispose();
			_rootNode = null;
		}

		public var _id : String;
		
		internal var _title :String;

		internal var _desc :String;

		internal var _date : Date;
		
		internal var _rootNode : INode;
		
		internal var _contentsProvider : ProjectContentProvider;

		//_____________________________________________________________________________
		//																 INodeDesriptor
		
		public function getChilds () : IIterator {
			return _contentsProvider.getContents();
		}

		public function getId () : String {
			return _id;
		}
		
		public function getDefaultId () : String {
			return null;
		}
		
	}
}
